﻿using SD.Infrastructure.EntityBase;
using System;

namespace SlamDunk.MES.Domain.Entities.AcquisitionContext
{
    /// <summary>
    /// 采集记录
    /// </summary>
    public class AcquisitionRecord : PlainEntity
    {
        #region # 构造器

        #region 00.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected AcquisitionRecord() { }
        #endregion

        #region 01.创建采集记录构造器
        /// <summary>
        /// 创建采集记录构造器
        /// </summary>
        /// <param name="acquiredTime">采集时间</param>
        /// <param name="variableNo">变量编号</param>
        /// <param name="variableName">变量名称</param>
        /// <param name="value">变量值</param>
        /// <param name="unit">单位</param>
        /// <param name="equipmentNo">设备编号</param>
        public AcquisitionRecord(DateTime acquiredTime, string variableNo, string variableName, decimal value, string unit, string equipmentNo)
            : this()
        {
            this.AcquiredTime = acquiredTime;
            this.VariableNo = variableNo;
            this.VariableName = variableName;
            this.Value = value;
            this.Unit = unit;
            this.EquipmentNo = equipmentNo;
        }
        #endregion

        #endregion

        #region # 属性

        #region 采集时间 —— DateTime AcquiredTime
        /// <summary>
        /// 采集时间
        /// </summary>
        public DateTime AcquiredTime { get; private set; }
        #endregion

        #region 变量编号 —— string VariableNo
        /// <summary>
        /// 变量编号
        /// </summary>
        public string VariableNo { get; private set; }
        #endregion

        #region 变量名称 —— string VariableName
        /// <summary>
        /// 变量名称
        /// </summary>
        public string VariableName { get; private set; }
        #endregion

        #region 变量值 —— decimal Value
        /// <summary>
        /// 变量值
        /// </summary>
        public decimal Value { get; private set; }
        #endregion

        #region 单位 —— string Unit
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; private set; }
        #endregion

        #region 设备编号 —— string EquipmentNo
        /// <summary>
        /// 设备编号
        /// </summary>
        public string EquipmentNo { get; private set; }
        #endregion

        #region 导航属性 - 采集会话 —— AcquisitionSession AcquisitionSession
        /// <summary>
        /// 导航属性 - 采集会话
        /// </summary>
        public virtual AcquisitionSession AcquisitionSession { get; internal set; }
        #endregion

        #endregion
    }
}
